using System;
using System.Drawing;
using PickGold.Charting;

namespace PickGold.Charting.Borders3D
{
	internal class FrameThin1Border : RaisedBorder
	{
		internal float[] innerCorners = new float[] { 15f, 15f, 15f, 15f, 15f, 15f, 15f, 15f };

		public FrameThin1Border()
		{
			base.sizeLeftTop = new SizeF(base.defaultRadiusSize * 0.8f, base.defaultRadiusSize * 0.8f);
			base.sizeRightBottom = new SizeF(base.defaultRadiusSize * 0.8f, base.defaultRadiusSize * 0.8f);
		}

		public override void DrawBorder(ChartGraphics graph, BorderSkin borderSkin, RectangleF rect, Color backColor, ChartHatchStyle backHatchStyle, string backImage, ChartImageWrapMode backImageWrapMode, Color backImageTransparentColor, ChartImageAlignmentStyle backImageAlign, GradientStyle backGradientStyle, Color backSecondaryColor, Color borderColor, int borderWidth, ChartDashStyle borderDashStyle)
		{
			base.drawBottomShadow = true;
			base.sunken = false;
			base.outsideShadowRate = 0.9f;
			base.drawOutsideTopLeftShadow = false;
			bool drawScrews = base.drawScrews;
			base.drawScrews = false;
			base.DrawBorder(graph, borderSkin, rect, borderSkin.BackColor, borderSkin.BackHatchStyle, borderSkin.BackImage, borderSkin.BackImageWrapMode, borderSkin.BackImageTransparentColor, borderSkin.BackImageAlignment, borderSkin.BackGradientStyle, borderSkin.BackSecondaryColor, borderSkin.BorderColor, borderSkin.BorderWidth, borderSkin.BorderDashStyle);
			base.drawScrews = drawScrews;
			rect.X += this.sizeLeftTop.Width;
			rect.Y += this.sizeLeftTop.Height;
			rect.Width -= this.sizeRightBottom.Width + this.sizeLeftTop.Width;
			rect.Height -= this.sizeRightBottom.Height + this.sizeLeftTop.Height;
			if ((rect.Width > 0f) && (rect.Height > 0f))
			{
				float[] numArray = new float[8];
				numArray = (float[])base.cornerRadius.Clone();
				base.cornerRadius = this.innerCorners;
				base.drawBottomShadow = false;
				base.sunken = true;
				base.drawOutsideTopLeftShadow = true;
				base.outsideShadowRate = 1.4f;
				Color pageColor = borderSkin.PageColor;
				borderSkin.PageColor = Color.Transparent;
				base.DrawBorder(graph, borderSkin, rect, backColor, backHatchStyle, backImage, backImageWrapMode, backImageTransparentColor, backImageAlign, backGradientStyle, backSecondaryColor, borderColor, borderWidth, borderDashStyle);
				borderSkin.PageColor = pageColor;
				base.cornerRadius = numArray;
			}
		}

		public override string Name
		{
			get
			{
				return "FrameThin1";
			}
		}

		public override float Resolution
		{
			set
			{
				base.Resolution = value;
				float num = (15f * base.resolution) / 96f;
				this.innerCorners = new float[] { num, num, num, num, num, num, num, num };
				base.sizeLeftTop = new SizeF(base.defaultRadiusSize * 0.8f, base.defaultRadiusSize * 0.8f);
				base.sizeRightBottom = new SizeF(base.defaultRadiusSize * 0.8f, base.defaultRadiusSize * 0.8f);
			}
		}
	}
}

